package com.etone.smartAudit.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author: sovy
 * @date: 2020/11/18
 * @description: 模型数据字典
 */

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "d_data_meta")
public class DataMeta implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "intId", type = IdType.AUTO)
    private Integer id;

    /**
     * 数据模型ID，对应d_iap_data_model的id
     */
    @TableField(value = "intModelId")
    private Integer modelId;

    /**
     * 字段名称
     */
    @TableField(value = "vcFieldName")
    private String fieldName;

    /**
     * 类型
     */
    @TableField(value = "vcType")
    private String type;

    /**
     * 默认值
     */
    @TableField(value = "vcDefaultValue")
    private String defaultValue;

    /**
     * 说明
     */
    @TableField(value = "vcComment")
    private String comment;

    /**
     * 是否主键，0:非，1:是
     */
    @TableField(value = "intPrimaryKey")
    private Boolean primaryKey;

    /**
     * 是否外键，0:非，1:是
     */
    @TableField(value = "intForeignKey")
    private Boolean foreignKey;

    /**
     * 外键说明(表名.字段名）
     */
    @TableField(value = "vcFKComment")
    private String fKComment;

    /**
     * 是否分区字段
     */
    @TableField(value = "intPartitionKey")
    private Boolean partitionKey;

    /**
     * 是否唯一约束
     */
    @TableField(value = "intUniqueKey")
    private Boolean uniqueKey;

    /**
     * 是否允许空值
     */
    @TableField(value = "intNullable")
    private Boolean nullable;

    private static final long serialVersionUID = 1L;
}